package com.gremlin.controller;

import com.gremlin.utils.SendEmailUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Description: 邮件接口
 * @author: gremlin
 * Date: 2022/3/4 10:54
 * @version: 1.0.0
 */
@Slf4j
@Controller
@RequestMapping("email")
@Api(value = "邮件",tags = "邮件")
public class SendEmailController {

    @PostMapping("sendEmail")
    @ApiOperation(value = "邮件-发送邮件", notes = "邮件-发送邮件")
    public void sendEmail(){
        try {
            SendEmailUtils.sendEmailConfig();
            log.info("发送成功！");
        }catch (Exception e){
            log.info("发送异常！");
            e.fillInStackTrace();
        }
    }
}
